from unittest import TestCase
from 计算器 import Calc
import 测试数据 as t
from ddt import ddt, data, unpack

@ddt
class TestLogin(TestCase):
    @data(*t.data[0])
    @unpack
    def testAdd(self,a,b,c):
        result=Calc().加(a,b)
        self.assertEqual(c,result)

    @data(*t.data[1])
    @unpack
    def testSUB(self, a, b, c):
        result = Calc().减(a, b)
        self.assertEqual(result,c)

    @data(*t.data[2])
    @unpack
    def testX(self, a, b, c):
        result = Calc().乘(a, b)
        self.assertEqual(result, c)

    @data(*t.data[3])
    @unpack
    def testD(self,a,b,c):
        result=Calc().除(a,b)
        self.assertEqual(c,result)


